<template>
  <div class="MainTitle">
    <div id="detailSubtitle">
      <div class="detailSubtitle-title">
        <span>{{ text }}</span>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { Cell, CellGroup, Dialog, Step, Steps, Form, Field, Picker } from 'vant';

//因为这里用了script的setup方式就用不到 defineComponent 这个定义组件的api了
import {
  useSlots,
  useAttrs,
  defineProps,
  onMounted,
  watchEffect,
  ref,
  reactive,
  PropType,
  watch,
} from 'vue';

//获取子组件传的值
const props = defineProps({
  text: {
    // type:  Array as () => Array<string>, //(string也可以是其他你自定义的接口)
    type: String,
    required: true,
    default: '-',
  },
});

onMounted(() => {
  //console.log('onMounted:', PerSonal.docAdmiNote?.admissionNum);
});

// 1.监听对象 赋值
watch(
  () => props.text,
  (text) => {
    //
  },
  {
    deep: true, // 深度监听的参数
    immediate: true, //绑定值就开始执行监听
  },
);

//watchEffect 会最先执行
/*watchEffect(() => {

});*/
</script>

<style scoped lang="scss">
/* 占位副标题 左边是 绿色小块,css */
.MainTitle {
  #detailSubtitle {
    font-size: 18px;
    color: #333333;
    padding-left: 16px;
    padding-top: 16px;
  }
  #detailSubtitle .detailSubtitle-title {
    display: flex;
    align-items: center;
    line-height: 22px;
  }
  #detailSubtitle .detailSubtitle-title::before {
    content: '';
    width: 5px;
    height: 15px;
    margin-right: 7px;
    background: #40bb90;
  }
}
</style>
